#include "header/pyramid_lights.h"



NodePtr createFireLight(NodePtr nBeacon, NodePtr nChild)
{
	NodePtr nLight = Node::create();
	PointLightPtr pLight = PointLight::create();
    
    beginEditCP(nLight);
    	nLight->setCore(pLight);
    	nLight->addChild(nChild);
    endEditCP(nLight);

    beginEditCP(pLight);
        //Attenuation parameters
        pLight->setConstantAttenuation(0.005); 		// 0.005
        pLight->setLinearAttenuation(0); 			// 0
        pLight->setQuadraticAttenuation(0.000035);  	// 0.00003
        
        //color information
        pLight->setDiffuse(Color4f(0.55, 0.35, 0.25, 1));	
        pLight->setAmbient(Color4f(0.1, 0.1, 0.1, 1));
        pLight->setSpecular(Color4f(0.1, 0.1, 0.1, 1));
        /*
        pLight->setDiffuse(Color4f(0.8, 0.5, 0.4, 1));	
        pLight->setAmbient(Color4f(0.1, 0.1, 0.1, 1));
        pLight->setSpecular(Color4f(0.1, 0.1, 0.1, 1));
        */
        
        //pLight->setShadowIntensity(0.8);
        
        //set the beacon
        pLight->setBeacon(nBeacon);
    endEditCP  (pLight);
    
    return nLight;
}

NodePtr createBlueLight(NodePtr nBeacon, NodePtr nChild)
{
	NodePtr nLight = Node::create();
	PointLightPtr pLight = PointLight::create();
    
    beginEditCP(nLight);
    	nLight->setCore(pLight);
    	nLight->addChild(nChild);
    endEditCP(nLight);

    beginEditCP(pLight);
        //Attenuation parameters
        //pLight->setConstantAttenuation(0); 		// 0.05
        //pLight->setLinearAttenuation(0); 			// 0
        pLight->setQuadraticAttenuation(0.00000002);  	// 0.00002
        
        //color information
        pLight->setDiffuse(Color4f(0.4, 0.4, 2.9, 1));	
        pLight->setAmbient(Color4f(0.4, 0.4, 0.9, 1));
        pLight->setSpecular(Color4f(0.4, 0.4, 1.9, 1));
        
        //pLight->setShadowIntensity(0.8);
        
        //set the beacon
        pLight->setBeacon(nBeacon);
    endEditCP  (pLight);
    
    return nLight;
}


NodePtr createSunLight(NodePtr nBeacon, NodePtr nChild)
{
	NodePtr nLight = Node::create();
	PointLightPtr pLight = PointLight::create();
    
    beginEditCP(nLight);
    	nLight->setCore(pLight);
    	nLight->addChild(nChild);
    endEditCP(nLight);

    beginEditCP(pLight);
        //Attenuation parameters
        pLight->setConstantAttenuation(1); 
        pLight->setLinearAttenuation(0); 
        pLight->setQuadraticAttenuation(0);  
        
        //color information
        pLight->setDiffuse(Color4f(15, 15, 15, 1));	
        pLight->setAmbient(Color4f(0.2, 0.2, 0.2, 1));
        pLight->setSpecular(Color4f(1, 1, 1, 1));
        
        //pLight->setShadowIntensity(0.8);
        
        //set the beacon
        pLight->setBeacon(nBeacon);
    endEditCP  (pLight);
    
    return nLight;
}

